#@author     : Zhu Fei
#@date       : 2023-04-07
#@description: CMakeLists.txt for building Physika tests
#@version    : 1.0

cmake_minimum_required(VERSION 3.11.4)

project(physika_tests)

include(FetchContent)

FetchContent_Declare(
        googletest
        GIT_REPOSITORY https://github.com/google/googletest.git
        GIT_TAG main
        GIT_SHALLOW 1
    )
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# # so that googletest does not get installed with our project
# option(INSTALL_GTEST "Enable installation of googletest." OFF)
#FetchContent_MakeAvailable(googletest)

# fix gtest unresolved external symbol issue:
# https://github.com/google/googletest/issues/2535
if(MSVC)
    add_compile_definitions(GTEST_LINKED_AS_SHARED_LIBRARY)
endif()

add_subdirectory(${TEST_ROOT}/framework)